<template>
  <section class="pageMain">
    <img class="headImg" :src="imgss[0].image" alt="">
    <div class="showTitle">
      <img class="titleBack" src="@/assets/titleBack.png" alt="">
      <div class="mainTitle">DOWNLOAD CENTER</div>
      <div class="subTitle">{{ $t('download.title') }}</div>
    </div>
    <div class="down">
      <div class="downRow title">
        <div>{{ $t('download.l1') }}</div>
        <div>{{ $t('download.l2') }}</div>
        <div>{{ $t('download.l3') }}</div>
        <div>{{ $t('download.l4') }}</div>
      </div>
      <div class="downRow item" v-for="item in list">
        <div>{{ item.title }}</div>
        <div>{{ item.file_size }}KB</div>
        <div>{{ item.file_type }}</div>
        <div><a :href="$assetsURL + item.file_src"><img src="@/assets/down.png" alt=""></a></div>
      </div>
    </div>
    <div class="pagination">
      <el-pagination
          @current-change="pageChange"
          layout="prev, pager, next"
          :total="total">
      </el-pagination>
    </div>

  </section>

</template>

<script>
import {getDownload} from "@/api/download";

export default {
  name: "productClass",
  data: () => ({
    list: [],
    total: 0,
    page: 1,
    image:""
  }),
  created() {
    this.getDownloadHandle()
    let arr = this.$store.state.storeThereNavList
    for (let i = 0; i < arr.length; i++) {
      if (arr[i].mid == 10) {
        this.image = arr[i].image
        break;
      }
    }
  },
  computed:{
    imgss(){
      return this.$store.state.storeThereNavList.filter(item => item.mid == 12)
    }
  },
  methods: {
    pageChange(page) {
      this.page = page
      this.getDownloadHandle()
    },
    getDownloadHandle() {
      getDownload({page: this.page}).then(res => {
        this.list = res.data.data
        this.total = res.data.total
      }).catch(err => {

      })
    }
  }
}
</script>


<style scoped lang="less">
.pageMain {

  .headImg {
    width: 100%;
    height: 300px;
  }

  .showTitle {
    padding: 60px;
    box-sizing: content-box;
    position: relative;
    text-align: center;
    height: 126px;

    .titleBack {
      position: absolute;
      left: calc((100% - 30px) / 2);
      width: 30px;
      height: 127px;
    }

    .mainTitle {
      font-weight: 800;
      font-size: 36px;
      color: #333333;
      margin-top: 25px;
    }

    .subTitle {
      color: #00A3E6;
      font-size: 18px;
    }
  }

  .down {
    margin: 0 auto 50px auto;
    width: 1200px;
    border: 1px solid #D8D8D8;

    .downRow {
      display: flex;
      width: 100%;

      div {
        width: 300px;
        padding: 12px 20px;

        img {
          width: 16px;
          height: 16px;
          cursor: pointer;
        }
      }

      div:nth-child(4) {
        text-align: right;
      }
    }

    .item {
      font-size: 14px;
      color: #00A3E6;
    }

    .title {
      color: #333333;
      font-weight: bold;
      font-size: 14px;
      background-color: #F6F6F6;
    }
  }

  .pagination {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
  }
}


</style>